<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>订单打印详情</title>
<link href="__TPL_CSS__/print1.css" rel="stylesheet" type="text/css"/>
</head>
<body>

<div class="print-page" id="printDiv1">
  <div class="orderprint">
	  {if $qrshow===1}
	  <div class="qrcode">
	  	<img src="{:U('Result/rqcode',['str'=>$qrcode,'d'=>0,'pass'=>64],true,'api')}"/>
		<div>{$qr_tips}</div>
	  </div>
	  {/if}
      <div class="top">
		<div class="full-title">{$title}</div>
		<div class="full-title2"><u>&nbsp;&nbsp;&nbsp;销售出货单&nbsp;&nbsp;&nbsp;</u></div>
		<div class="full-title3">联系电话：{$phone}</div>
	</div>
      <table class="buyer-info">
        <tr>
          <td height="22" class="w240">订单号：<span class="form-control-static">{$T.number} </span></td>          
        </tr>
        <tr>
          <td height="22">客户：{if $T.customer.company == ''}{$T.customer.name}{else/}{$T.customer.company}{/if}</td>
          <td height="22" align="right"><span class="form-control-static">{$T.create_time|date="Y年m月d日"}</span></td>
        </tr>
      </table>
      <table class="order-info">
        <thead>
          <tr>
            <th width="5%">编号</th>
            <th width="17%">品名</th>
            <th width="5%">色号</th>
            <th width="7%">颜色</th>
            <th width="3%"></th>
            <th width="5%">1</th>
            <th width="5%">2</th>
            <th width="5%">3</th>
            <th width="5%">4</th>
            <th width="5%">5</th>
            <th width="5%">6</th>
            <th width="5%">7</th>
            <th width="5%">8</th>
            <th width="5%">数量</th>
            <th width="4%">单位</th>
            <th width="5%">单价</th>
            <th width="9%">金额</th>
          </tr>
        </thead>
        <tbody>
           {volist name="Tinfo" id="v"}
            <tr>
                <td>{$v.number}</td>
                <td style="text-align:left; padding:0px 5px;">{$v.name}</td>
                <td>{$v.color}</td>
                <td>{$v.colorname}</td>
                <td style="background:#{$v.colorval}"></td>
                {php}
                foreach($v['weight'] as $val){
                   echo '<td>'.$val.'</td>';
                }
                {/php}
                <td>{$v.count}</td>
                <td>{$v.unit}</td>
                <td>{$v.unitprice|price_one}</td>
                <td class="right">{$v.total|price_one}</td>
            </tr>
            {/volist}
            {php}
            $len=10-count($Tinfo);
            if($len>0){
              for($i=0;$i<=$len;$i++){
                echo '<tr><td>&nbsp;</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
              }
            }
            {/php}
        </tbody>
        <tfoot>
          <tr>
            <td colspan="7" style="text-align:left; padding-left:5px;">总金额（大写）RMB ：<span class="cny">{$T.total|cny}</span></td>
            <td colspan="10" style="text-align:right; padding-right:5px;">
				共 {$T.volume} 匹 &nbsp;&nbsp;&nbsp;&nbsp;
				数量：{$T.count}&nbsp;&nbsp;
				{if $T['freight'] > 0}运费：&yen; {$T.freight|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] > 0 && $T['paytype']=='公账开票'}税费：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] > 0 && $T['paytype']!='公账开票'}差价：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] < 0}优惠：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				总计：&yen; {$T.total|price}
			</td>
          </tr>
          <tr class="remark">
            <td colspan="17" style="text-align:left;">{$remark|raw}</td>
          </tr>
        </tfoot>
      </table>
    <div class="explain">
  </div>
  </div>
</div>

<div class="print-page" id="printDiv2" style="display:none">
  <div class="orderprint">
	  {if $qrshow===1 && $qrprint===1}
	  <div class="qrcode">
	  	<img src="{:U('Result/rqcode',['str'=>$qrcode,'d'=>0,'pass'=>64],true,'api')}"/>
	  		<div>{$qr_tips}</div>
	  </div>
	  {/if}
      <div class="top">
		<div class="full-title">{$title}</div>
		<div class="full-title2"><u>&nbsp;&nbsp;&nbsp;销售出货单&nbsp;&nbsp;&nbsp;</u></div>
		<div class="full-title3">联系电话：{$phone}</div>
    </div>
      <table class="buyer-info">
        <tr>
          <td height="22" class="w240">订单号：<span class="form-control-static">{$T.number} </span></td>          
        </tr>
        <tr>
          <td height="22">客户：{if $T.customer.company == ''}{$T.customer.name}{else/}{$T.customer.company}{/if}</td>
          <td height="22" align="right"><span class="form-control-static">{$T.create_time|date="Y年m月d日"}</span></td>
        </tr>
      </table>
      <table class="order-info">
        <thead>
          <tr>
            <th width="20%">品名</th>
            <th width="7%">色号</th>
            <th width="5%">1</th>
            <th width="5%">2</th>
            <th width="5%">3</th>
            <th width="5%">4</th>
            <th width="5%">5</th>
            <th width="5%">6</th>
            <th width="5%">7</th>
            <th width="5%">8</th>
            <th width="5%">数量</th>
            <th width="4%">单位</th>
          </tr>
        </thead>
        <tbody>
           {volist name="Tinfo" id="v"}
            <tr>
                <td style="text-align:left; padding:0px 5px;">{$v.number}#{$v.name}</td>
                <td>{$v.color}#{$v.colorname}</td>
                {php}
                foreach($v['weight'] as $val){
                   echo '<td>'.$val.'</td>';
                }
                {/php}
                <td>{$v.count}</td>
                <td>{$v.unit}</td>
            </tr>
            {/volist}
            {php}
            $len=10-count($Tinfo);
            if($len>0){
              for($i=0;$i<=$len;$i++){
                echo '<tr><td>&nbsp;</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
              }
            }
            {/php}
        </tbody>
        <tfoot>
          <tr>
            <td colspan="7" style="text-align:left; padding-left:5px;"></td>
            <td colspan="8" style="text-align:right; padding-right:5px;">共 {$T.volume} 匹 &nbsp;&nbsp;&nbsp;&nbsp;数量：{$T.count}&nbsp;&nbsp;</td>
          </tr>
          <tr class="remark">
            <td colspan="17" style="text-align:left;">{$remark|raw}</td>
          </tr>
        </tfoot>
      </table>
    <div class="explain">
  </div>
  </div>
</div>

<!--//打印的内容//-->

<div class="print-page" id="printDiv" style="display:none">
  <div id="printarea">
  <div class="orderprint">
	  {if $qrshow===1 && $qrprint===1}
	  <div class="qrcode">
	  	<img src="{:U('Result/rqcode',['str'=>$qrcode,'d'=>0,'pass'=>64],true,'api')}"/>
		<div>{$qr_tips}</div>
	  </div>
	  {/if}
      <div class="top">
		<div class="full-title">{$title}</div>
		<div class="full-title2"><u>&nbsp;&nbsp;&nbsp;销售出货单&nbsp;&nbsp;&nbsp;</u></div>
		<div class="full-title3">联系电话：{$phone}</div>
    </div>
      <table class="buyer-info">
        <tr>
          <td height="22" class="w240">订单号：<span class="form-control-static">{$T.number} </span></td>          
        </tr>
        <tr>
          <td height="22">客户：{if $T.customer.company == ''}{$T.customer.name}{else/}{$T.customer.company}{/if}</td>
          <td height="22" align="right"><span class="form-control-static">{$T.create_time|date="Y年m月d日"}</span></td>
        </tr>
      </table>
      <table class="order-info">
        <thead>
          <tr>
            <th width="22%">品名</th>
            <th width="10%">颜色</th>
            <th width="5%">1</th>
            <th width="5%">2</th>
            <th width="5%">3</th>
            <th width="5%">4</th>
            <th width="5%">5</th>
            <th width="5%">6</th>
            <th width="5%">7</th>
            <th width="5%">8</th>
            <th width="6%">数量</th>
            <th width="5%">单位</th>
            <th width="6%">单价</th>
            <th width="11%">金额</th>
          </tr>
        </thead>
        <tbody>
           {volist name="Tinfo" id="v"}
            <tr>
                <td style="text-align:left; padding:0px 5px;">{$v.number}#{$v.name}</td>
                <td>{$v.color}#{$v.colorname}</td>
                {php}
                foreach($v['weight'] as $val){
                   echo '<td>'.$val.'</td>';
                }
                {/php}
                <td>{$v.count}</td>
                <td>{$v.unit}</td>
                <td>{$v.unitprice|price_one}</td>
                <td class="right">{$v.total|price_one}</td>
            </tr>
            {/volist}
            {php}
            $len=10-count($Tinfo);
            if($len>0){
              for($i=0;$i<=$len;$i++){
                echo '<tr><td>&nbsp;</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>';
              }
            }
            {/php}
        </tbody>
        <tfoot>
          <tr>
            <td colspan="7" style="text-align:left; padding-left:5px;">总金额（大写）RMB ：<span class="cny">{$T.total|cny}</span></td>
            <td colspan="8" style="text-align:right; padding-right:5px;">
				共 {$T.volume} 匹 &nbsp;&nbsp;&nbsp;&nbsp;
				数量：{$T.count}&nbsp;&nbsp;
				{if $T['freight'] > 0}运费：&yen; {$T.freight|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] > 0 && $T['paytype']=='公账开票'}税费：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] > 0 && $T['paytype']!='公账开票'}差价：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				{if $T['coupon'] < 0}优惠：&yen; {$T.coupon|price_one}&nbsp;&nbsp;{/if}
				总计：&yen; {$T.total|price}
			</td>
          </tr>
          <tr class="remark">
            <td colspan="15" style="text-align:left;">{$remark|raw}</td>
          </tr>
        </tfoot>
      </table>
    <div class="explain">
  </div>
  <!--<div class="tc page">第1页/共1页</div>-->
  </div>
  </div>
</div>

<div class="print_but">
<a href="javascript:prnt_preview()">打印订单</a> &nbsp;&nbsp;
<a href="javascript:showcolor()" style="background:#41cac0;border:1px solid #41cac0">显示/隐藏颜色</a> &nbsp;&nbsp;
<a href="javascript:showprice()" style="background:#78CD51;border:1px solid #41cac0">显示/隐藏价格</a>
</div>

<script type="text/javascript" src="__TOOL__/print/LodopFuncs.js" charset="utf-8"></script>
<object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
       <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
</object>
<script>
var print_id='printDiv';
setTimeout("CheckIsInstall()","1000");
function CheckIsInstall() {
    try{ 
         var LODOP=getLodop(); 
      if (LODOP.VERSION) {
         if (LODOP.CVERSION){
         //alert("当前有C-Lodop云打印可用!\n C-Lodop版本:"+LODOP.CVERSION+"(内含Lodop"+LODOP.VERSION+")"); 
         }else{
         //alert("本机已成功安装了Lodop控件！\n 版本号:"+LODOP.VERSION); 
         }
      };
     }catch(err){ 
     }
  }; 


var LODOP; //声明为全局变量 
function getid(id){
  return document.getElementById(id);
}
function prnt_preview() { 
  CreateOneFormPage();  
  LODOP.PREVIEW();  
};
function showcolor(){
  if(getid('printDiv').style.display=='none'){
    getid('printDiv').style.display='block';
    getid('printDiv1').style.display='none';
    getid('printDiv2').style.display='none';
  }else{
    getid('printDiv1').style.display='block';
    getid('printDiv').style.display='none';
    getid('printDiv2').style.display='none';
  }
  print_id="printDiv";
}
function showprice(){
  if(getid('printDiv2').style.display=='none'){
    getid('printDiv2').style.display='block';
    getid('printDiv').style.display='none';
    getid('printDiv1').style.display='none';
    print_id="printDiv2";
  }else{
    getid('printDiv2').style.display='none';
    getid('printDiv').style.display='block';
    getid('printDiv1').style.display='none';
    print_id="printDiv";
  }
}
function CreateOneFormPage(){
  var cssStyle='<link href="__TPL_CSS__/print1.css" rel="stylesheet" type="text/css"/>';
  var printArea=getid(print_id).innerHTML;
  printArea=cssStyle+'<body>'+printArea+'</body>';

  LODOP=getLodop();  
  LODOP.PRINT_INIT();
  LODOP.SET_PRINT_STYLEA(1,"Horient",3);
  LODOP.SET_PRINT_PAGESIZE(3,'210mm','148mm','A5');
  LODOP.SET_PRINT_STYLE("FontSize",14);
  LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",true);
  LODOP.ADD_PRINT_HTM(0,0,'210mm','148mm',printArea);
};
</script>
</body>
</html>